package com.sky.sky_server.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.sky.sky_pojo.entity.Employee;
import com.sky.sky_pojo.entity.EmployeeQueryPage;

@Mapper
public interface EmployeeMapper {

    /**
     * 新增员工
     * @param employee
     * @return
     */
    @Insert("insert into employee (username, password, name, phone, sex, id_number, status, create_time, update_time, create_user, update_user) values (#{username}, #{password}, #{name}, #{phone}, #{sex}, #{idNumber}, #{status}, #{createTime}, #{updateTime}, #{createUser}, #{updateUser})")
    int insert(Employee employee);

    /**
     * 查询所有员工
     * @return
     */
    List<Employee> findAllEmployee(EmployeeQueryPage ePage);

    /**
     * 修改员工信息
     * @param emp
     */
    int update(Employee emp);

    /**
     * 根据id查询员工
     * @param id
     * @return
     */
    @Select("select * from employee where id = #{id}")
    Employee findById(Long id);
    
}
